package com.cug.zfanspring.service;

import com.cug.zfanspring.bean.Device;
import com.cug.zfanspring.mapper.DeviceMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class DeviceDataService {
    @Autowired
    DeviceMapper deviceMapper;
    public List<Device> getLatestAlarmDeviceData(){
        return deviceMapper.getLatestAlarmDeviceData();
    }
    public List<Device> getAlarmDeviceData(){
        return deviceMapper.getAlarmDeviceData();
    }
    public List<String> getAreaName(){return deviceMapper.getAreaName();}
    public void updateDeviceData(List<Device> deviceData){
        deviceMapper.updateDeviceData(deviceData);
    }
    public void updateLatestDeviceData(List<Device> deviceData){
        deviceMapper.updateLatestDeviceData(deviceData);
    }
}
